using System;
using System.Collections.Generic;
using System.Text;

namespace Decav.Gatsb
{
    /// <summary>
    /// Holds information regarding the result of logging in a user.
    /// </summary>
    [Serializable]
    public class UserLoginResult
    {
        public UserLoginResult(bool authenticated, bool validate, bool requiresSetup, User user)
        {
            _requiresSetup = requiresSetup;
            _authenticated = authenticated;
            _validate = validate;
            _user = user;
        }

        private bool _authenticated;
        private User _user;
        private bool _validate;
        private bool _requiresSetup;

        /// <summary>
        /// Gets the failure state of the <see cref="UserLoginResult"/>.
        /// </summary>
        public static readonly UserLoginResult Failed = new UserLoginResult(false, false, false, null);

        /// <summary>
        /// Gets whether or not account validation is required prior to continuing.
        /// </summary>
        public bool RequiresValidation
        {
            get
            {
                return _validate;
            }
        }

        /// <summary>
        /// Gets whether or not this authentication requires setup prior to continuing.
        /// This usually occurs when a user created their account on a mobile device and needs
        /// to complete setup.
        /// </summary>
        public bool RequiresSetup
        {
            get
            {
                return _requiresSetup;
            }
        }

        /// <summary>
        /// Gets true when the login was a success.
        /// </summary>
        public bool Authenticated
        {
            get
            {
                return _authenticated;
            }
        }

        /// <summary>
        /// Gets the user that was logged in.
        /// </summary>
        public User User
        {
            get
            {
                return _user;
            }
        }
    }
}
